package com.dong.burst.ioc;

import com.dong.burst.ioc.bean.User;
import com.dong.burst.ioc.bean.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class IocBurst {
	public static void main(String[] args) {
		ApplicationContext applicationContext = new AnnotationConfigApplicationContext("com.dong.burst.ioc.bean");
		UserService userService = applicationContext.getBean(UserService.class);
		userService.sayHello();
		//FactoryBean
		final User bean1 = applicationContext.getBean(User.class);
		final Object bean2 = applicationContext.getBean("&user");
		System.out.println(bean1);
		System.out.println(bean2);
	}
}
